package com.alick.third_push.xgpush;

import android.content.Context;

import com.tencent.android.tpush.XGPushBaseReceiver;
import com.tencent.android.tpush.XGPushClickedResult;
import com.tencent.android.tpush.XGPushRegisterResult;
import com.tencent.android.tpush.XGPushShowedResult;
import com.tencent.android.tpush.XGPushTextMessage;

/**
 * 功能:
 * 作者: 崔兴旺
 * 日期: 2017/11/23
 * 备注:
 */
public class XGMessageReceiver extends XGPushBaseReceiver{

    @Override
    public void onRegisterResult(Context context, int i, XGPushRegisterResult xgPushRegisterResult) {

    }

    @Override
    public void onUnregisterResult(Context context, int i) {

    }

    @Override
    public void onSetTagResult(Context context, int i, String s) {

    }

    @Override
    public void onDeleteTagResult(Context context, int i, String s) {

    }

    @Override
    public void onTextMessage(Context context, XGPushTextMessage xgPushTextMessage) {
        //信鸽推送服务端在Rest API填写的自定义消息为"{"custom_content": {"joke_id":"6613","notification_id":"100","title":"测试信鸽标题","content":"测试信鸽内容"}}"
        String customContent=null;
        /*try {
            customContent = xgPushTextMessage.getCustomContent();
            NotificationMsg notificationMsg = JsonUtils.parseJson2Bean(customContent, NotificationMsg.class);
            notificationMsg.setPush_channel(BizContant.PushChannel.XGPUSH);
            PushNotificationManager.getInstance().onReceiveNotification(context, notificationMsg);
        } catch (Exception e) {
            e.printStackTrace();
            BLog.e("信鸽推送收到透传消息,解析失败异常:"+e.getMessage()+",消息:"+customContent);
        }*/
    }

    @Override
    public void onNotifactionClickedResult(Context context, XGPushClickedResult xgPushClickedResult) {

    }

    @Override
    public void onNotifactionShowedResult(Context context, XGPushShowedResult xgPushShowedResult) {

    }
}
